Changing Memory Allocation Behavior

You can customize default behavior for how the RTX64 Subsystem interacts with Windows during memory allocation from the Configure Memory Allocation Behavior control panel page. See below for complete descriptions of the available settings.

You can configure RTX64's default memory allocation behavior to use local memory or to request memory from Windows. Local memory is a pool of memory that can be configured to fulfill RTSS application memory requests. RTSS applications that allocate memory from the local pool will receive memory deterministically from the subsystem when the pool has the requested memory available. The local memory pool is created when the first RTSS application starts when the subsystem is set to use local memory by default, otherwise it is created on the first call to allocate memory from the local pool. It provides deterministic behavior for normally non-deterministic functions, as well as greater flexibility and functionality after a system crash (blue screen).

You can specify the initial size of the local memory pool, in kilobytes. If RTSS applications exhaust the memory you initially allocate, you can configure RTX64 to automatically request additional memory from Windows. Note that requesting memory from Windows introducing non-deterministic behavior during the expansion of the pool and cannot be called in the shutdown handler. To avoid this scenario, it is important to be aware of your applications' memory needs and specify an initial pool size that will support them.

For more information on using local memory with RTX64, see Local Memory.

NOTE: Some changes to the RTX64 Control Panel require a restart of the RTSS Subsystem.

 

ClosedAccessing the Memory Allocation Behavior options

The method you use to access these control panel options will depend on the operating system you are running.

To open the control panel in Windows 10 and Windows 8.1:

  1. From the Windows Apps menu, navigate to the RTX64 Runtime section and click the Control Panel tile.
  2. Click Configure the RTSS Subsystem > Configure Memory Allocation Behavior.

To open the control panel in Windows 7:

  1. Click the Start menu and then choose Control Panel.
  2. In the Windows control panel, select the System and Security category, and then click RTX64.
  3. Click Configure the RTSS Subsystem > Configure Memory Allocation Behavior.

 

Sections in this topic

Setting Subsystem and application memory allocation defaults

Customizing the initial size of the RTX64 local memory pool

Expanding and shrinking the local memory pool

Setting Subsystem and Application Memory Allocation Defaults

You can configure RTX64's default memory allocation behavior to use local memory or to request memory from Windows. Local memory is a pool of memory that can be configured to fulfill RTSS application memory requests. RTSS applications that allocate memory from the local pool will receive memory deterministically from the Subsystem when the pool has the requested memory available. The local memory pool is created when the first RTSS application starts or when the first call to allocate local memory is called. It provides deterministic behavior for normally non-deterministic functions, as well as greater flexibility and functionality after a system crash (blue screen).

To set Subsystem and application memory allocation defaults:

Select an option to configure default memory allocation behavior:

 

Customizing the Initial Size of the RTX64 Local Memory Pool

You can specify the initial size of the local memory pool, in kilobytes. If RTSS applications exhaust the memory you initially allocate, you can configure RTX64 to automatically request additional memory from Windows. Note that requesting memory from Windows introduces non-deterministic activity during the expansion of the pool and cannot be called in the shutdown handler. To avoid this scenario, it is important to be aware of your applications' memory needs and specify an initial pool size that will support them. For more information on using local memory with RTX64, see Local Memory.

NOTE: There is a known issue where the local memory Initial Size and Expansion Size values cannot exceed 4 gigabytes. This limitation will be resolved in a future release.

To customize the initial size of the local memory pool:

  1. In the Local memory pool size field, drag the slider or enter a size (in kilobytes) of the local memory pool.
  1. Restart RTX64 for your changes to take effect. If you plan to make additional changes that require a restart of the Subsystem, make all of the changes first and then restart RTX64 when you are finished.

Allocating Memory for the RT-TCP/IP Stack and Virtual Network

If you are using the optional RT-TCP/IP Stack with the Virtual Network, you should use the following formula to determine the amount of memory you need to allocate:

Subsystem + RT-TCP/IP Stack + Driver Interfaces + Virtual Network + Application = Memory Needed

For example:

1024 + 3072 + 0 + 2048 + 4096 = 10240

 

Expanding and Shrinking the Local Memory Pool

You can configure RTX64 to automatically request additional memory (expand) from Windows once the local memory pool, defined by the Pool size value, is exhausted. Note that expanding memory introduces non-deterministic behavior. If you disable auto expand and the memory requested is not available in the local pool your memory allocation request will fail. You can also choose to auto shrink the local memory pool.

NOTE: There is a known issue where the local memory Initial Size and Expansion Size values cannot exceed 4 gigabytes. This limitation will be resolved in a future release.

To configure Auto Expand behavior:

The expand size determines the minimum amount of additional memory that will be requested from Windows when the local pool is exhausted. If you allocate an amount larger than the expansion size, the larger size will be used. The expansion size is set to 4096 bytes by default.

  1. Check the Auto expand check box to enable expansion, or uncheck it to disable expansion.
  2. If you have enabled expansion, set the expansion size by dragging the slider or enter an expansion size, in kilobytes.
  3. Restart RTX64 for your changes to take effect. If you plan to make additional changes that require a restart of the Subsystem, make all of the changes first and then restart RTX64 when you are finished.

NOTE: If you configure the RT-TCP/IP Stack to start with the Subsystem, and memory allocation behavior is configured to Request from local memory pool (deterministic), you must also select the Auto expand check box. When Auto expand is not selected in this scenario, the Stack will not start due to lack of memory.

To configure Auto Shrink behavior:

Enable Auto Shrink to shrink the RTSS local memory pool automatically whenever an RTSS process exits.

  1. Check the Auto shrink check box to enable shrinking of the memory pool, or uncheck it to disable shrinking.
  2. Restart RTX64 for your changes to take effect. If you plan to make additional changes that require a restart of the Subsystem, make all of the changes first and then restart RTX64 when you are finished.

Related topics: